package com.wxj.educms.controller;


import com.wxj.commonutils.result.R;
import com.wxj.educms.entity.CmsBanner;
import com.wxj.educms.service.CmsBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 首页banner表 前端控制器 前台
 * </p>
 *
 * @author wxj
 * @since 2021-03-13
 */
@RestController
@RequestMapping("/educms/bannerfront")
//@CrossOrigin
public class BannerFrontController {

    @Autowired
    private CmsBannerService bannerService;

    //查询所有banner
    @GetMapping("getAllBanner")
    public R getAllBanner() {
        List<CmsBanner> list = bannerService.selectAllBanner();
        return R.success().data("list",list);
    }


}
